#!/bin/bash

############################################################################
#
# 远程执行该脚本，请在命令行中直接执行以下命令：
#
#   curl -sSL https://gitee.com/tay3223/biubiubiu/raw/master/centos7-accelerate-docker.sh | /bin/bash
#
#
############################################################################

# 添加镜像加速源
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<EOF
{
    "registry-mirrors": [
        "https://dockerproxy.com",
        "https://docker.nju.edu.cn",
        "https://docker.mirrors.ustc.edu.cn",
        "https://ccr.ccs.tencentyun.com",
        "https://docker.m.daocloud.io",
        "https://hub-mirror.c.163.com",
        "https://mirror.baidubce.com"
    ],
    "exec-opts": [
        "native.cgroupdriver=systemd"
    ],
    "bip": "192.168.99.1/24",
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "100m",
        "max-file": "10"
    },
   "default-address-pools": [
    {
      "base": "192.168.100.1/24",
      "size": 24
    }
  ]
}
EOF
systemctl daemon-reload
systemctl restart docker
